package com.plian.system.wrapper.pm.property;

import com.plian.system.dto.pm.property.PropertyChangeDTO;
import com.plian.system.entity.pm.property.*;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.pm.property.PropertyChangeVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

import static com.plian.system.wrapper.util.WrapperConstant.SPRING;

@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface PropertyChangeWrapper extends BaseWrapper<PropertyChange, PropertyChangeDTO, PropertyChangeVO> {

    @Mappings({
            @Mapping(target = "id", ignore = true),
            @Mapping(target = "formType", ignore = true),
            @Mapping(target = "createTime", ignore = true),
            @Mapping(target = "updateTime", ignore = true),
            @Mapping(target = "createUser", ignore = true),
            @Mapping(target = "updateUser", ignore = true),
            @Mapping(target = "fillOrgId", ignore = true),
            @Mapping(target = "status", ignore = true)
    })
    PropertyBasics changeToBasics(PropertyChange propertyChange);

    ContributorBasics contributorChangeToBasics(ContributorChange change);

    List<ContributorBasics> contributorChangeToBasics(List<ContributorChange> change);

    ContributorRecord contributorChangeToRecord(ContributorChange change);

    List<ContributorRecord> contributorChangeToRecord(List<ContributorChange> change);

    ShareholdingBasics shareholdingChangeToBasics(ShareholdingChange change);

    List<ShareholdingBasics> shareholdingChangeToBasics(List<ShareholdingChange> change);

    ShareholdingRecord shareholdingChangeToRecord(ShareholdingChange change);

    List<ShareholdingRecord> shareholdingChangeToRecord(List<ShareholdingChange> change);

    PartnerSituationBasics situationChangeToBasics(PartnerSituationChange change);

    List<PartnerSituationBasics> situationChangeToBasics(List<PartnerSituationChange> change);

    PartnerSituationRecord situationChangeToRecord(PartnerSituationChange change);

    List<PartnerSituationRecord> situationChangeToRecord(List<PartnerSituationChange> change);

    PartnerOutboundBasics outboundChangeToBasics(PartnerOutboundChange change);

    List<PartnerOutboundBasics> outboundChangeToBasics(List<PartnerOutboundChange> change);

    PartnerOutboundRecord outboundChangeToRecord(PartnerOutboundChange change);

    List<PartnerOutboundRecord> outboundChangeToRecord(List<PartnerOutboundChange> change);
}
